﻿using System;

using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;

namespace mvcForum.Tests.WebUI {

	public static class IWebElementExtensions {

		public static void Click(this IWebElement element, IWebDriver driver, String waitForId) {
			element.Click();

			WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, 10));
			wait.Until(drv => drv.FindElement(By.Id(waitForId)));
		}
	}
}